﻿using System.Collections.Generic;
using StreamBase.SB;

namespace Sbcx {

    /// <summary>
    /// Simple equality comparer based on the tuples' string representation
    /// </summary>
    /// <remarks>
    /// Great for low volume value equality
    /// </remarks>
    public class SimpleTupleEqualityComparer : IEqualityComparer<Tuple> {

        public bool Equals (Tuple x, Tuple y) {
            if (null != x && null != y)
                return x.ToString ().Equals (y.ToString ());
            else
                return false;
        }

        public int GetHashCode (Tuple obj) {
            return obj.GetHashCode ();
        }
    }
}